home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: Sept 1996
- // Author: dsw
- //
- // Description:
- // This script performs various GUI startup related tasks.
- // It is run only in GUI mode and not batch mode.
- //
- // Input Arguments:
- // None.
- //
- // Return Value:
- // None.
- //
- // Note:
- // None.
- //
-
- //
- // Set up some defaults for the tear-off panel sizes.
- // Normally, these windows use the last panel size but in
- // some cases this isn't a good fit.
- //
- windowPref -tlc 225 150 -wh 250 400 outlinerPanel1Window;
- windowPref -tlc 250 200 -wh 700 400 hyperGraphPanel1Window;
- windowPref -tlc 250 200 -wh 660 400 graphEditor1Window;
- windowPref -tlc 250 200 -wh 660 400 dopeSheetPanel1Window;
- windowPref -tlc 250 200 -wh 660 400 clipEditorPanel1Window;
- windowPref -tlc 250 200 -wh 560 430 multiListerPanel1Window;
- windowPref -tlc 250 200 -wh 524 470 devicePanel1Window;
- windowPref -tlc 250 200 -wh 700 400 hyperShadePanel1Window;
- windowPref -tlc 250 200 -wh 700 400 dynPaintScriptedPanelWindow;
-
- //
- // General
- //
- translator -cmp `optionVar -q fileCompressionMode`;
-
- snapMode
- -useTolerance `optionVar -q useSnapTolerance`
- -tolerance `optionVar -q snapTolerance`
- -uvTolerance `optionVar -q snapUVTolerance`
- -edgeMagnet `optionVar -q snapMagnet`
- -edgeMagnetTolerance `optionVar -q snapMagnetTolerance`;
-
- help -popupDisplayTime `optionVar -query helpPopupDisplayTime`;
-
- //
- // Selection
- //
- selectPref
- -singleBoxSelection `optionVar -q selectSingleMarquee`
- -clickDrag `optionVar -q selectClickDrag`
- -affectsActive `optionVar -q selectAffectsActive`
- -allowHiliteSelection true
- -ignoreSelectionPriority `optionVar -q ignoreSelectionPriority`
- -popupMenuSelection `optionVar -q popupMenuSelection`
- -expandPopupList `optionVar -q expandPopupList`
- -clickBoxSize `optionVar -q clickBoxSize`;
-
- global string $gSelectPriorityMode;
- global int $gCustomSelPriority[];
- global int $gCustomSelPriorityCount = 56;
-
- $gSelectPriorityMode = `optionVar -q selectPrefPriorityMode`;
- $gCustomSelPriority = `optionVar -q customSelectPriority`;
- selPriority $gSelectPriorityMode;
-
- //
- // Display
- //
-
- global int $gFastInteraction;
- $gFastInteraction = `optionVar -q fastInteraction`;
- displayLevelOfDetail -lod $gFastInteraction;
-
- displayPref -activeObjectPivots `optionVar -q activeObjectPivots`;
- displayPref -displayAffected `optionVar -q displayAffected`;
- displayPref -regionOfEffect `optionVar -q displayRegionOfEffect`;
- displayPref -shadeTemplates `optionVar -q shadeTemplates`;
- if (`optionVar -exists ghostFrameStep`) {
- displayPref -ghostFrames `optionVar -q ghostFramesBefore` `optionVar -q ghostFramesAfter` `optionVar -q ghostFrameStep`;
- }
-
- int $state = `optionVar -q wireframeOnShadedActive`;
- if ( $state == 1 )
- displayPref -wireframeOnShadedActive "full";
- else if ( $state == 2 )
- displayPref -wireframeOnShadedActive "reduced";
- else if ( $state == 3 )
- displayPref -wireframeOnShadedActive "none";
-
- toggleAxis -v `optionVar -q toggleViewAxis`
- -o `optionVar -q toggleOriginAxis`;
-
- global string $gPreviousWorkingUnitLinear;
-
- global float $gGridSpacingDefault = 5.0;
- global float $gGridDivisionsDefault = 5.0;
- global float $gGridSizeDefault = 12.0;
-
- global int $gGridDisplayAxesDefault = true;
- global int $gGridDisplayGridLinesDefault = true;
- global int $gGridDisplayDivisionLinesDefault = true;
- global int $gGridDisplayGridPerspLabelsDefault = false;
- global int $gGridDisplayGridOrthoLabelsDefault = false;
- global int $gGridDisplayAxesAccentedDefault = true;
-
- global string $gGridDisplayPerspLabelPositionDefault = "axis";
- global string $gGridDisplayOrthoLabelPositionDefault = "edge";
-
- grid -default
- -spacing $gGridSpacingDefault
- -divisions $gGridDivisionsDefault
- -size $gGridSizeDefault
- -displayAxes $gGridDisplayAxesDefault
- -displayGridLines $gGridDisplayGridLinesDefault
- -displayDivisionLines $gGridDisplayDivisionLinesDefault
- -displayPerspectiveLabels $gGridDisplayGridPerspLabelsDefault
- -displayOrthographicLabels $gGridDisplayGridOrthoLabelsDefault
- -displayAxesBold $gGridDisplayAxesAccentedDefault
- -perspectiveLabelPosition $gGridDisplayPerspLabelPositionDefault
- -orthographicLabelPosition $gGridDisplayOrthoLabelPositionDefault
- ;
-
- if( !`optionVar -exists gridSpacing`) {
- // If there is no preference file:
- //
- // set to the linearUnit before start.
- //
- currentUnit -l $gPreviousWorkingUnitLinear;
-
- // get the spacing under the previous workingUnitLinear.
- //
- optionVar
- -floatValue gridSpacing $gGridSpacingDefault
- -floatValue gridDivisions $gGridDivisionsDefault
- -floatValue gridSize $gGridSizeDefault
- ;
-
- // reset the linearUnit.
- //
- currentUnit -l `optionVar -q workingUnitLinear`;
- }
-
- // New grid display option variables for Maya 4.0. Don't include them
- // with the default initialization of the previous grid variable like
- // size and division because they may exist in previous pref versions
- // but these new variables will not.
- //
- if (!`optionVar -exists displayGridAxes`) {
- optionVar
- -intValue displayGridAxes $gGridDisplayAxesDefault
- -intValue displayGridLines $gGridDisplayGridLinesDefault
- -intValue displayDivisionLines $gGridDisplayDivisionLinesDefault
- -intValue displayPerspGridLabels $gGridDisplayGridPerspLabelsDefault
- -intValue displayOrthoGridLabels $gGridDisplayGridOrthoLabelsDefault
- -intValue displayGridAxesAccented $gGridDisplayAxesAccentedDefault
- ;
- }
- if (!`optionVar -exists displayGridPerspLabelPosition`) {
- optionVar
- -stringValue displayGridPerspLabelPosition $gGridDisplayPerspLabelPositionDefault
- -stringValue displayGridOrthoLabelPosition $gGridDisplayOrthoLabelPositionDefault
- ;
- }
-
- // set the spacing under the current working unit linear
- //
- grid -toggle `optionVar -query showGrid`
- -spacing `optionVar -query gridSpacing`
- -divisions `optionVar -query gridDivisions`
- -size `optionVar -query gridSize`
- -displayAxes `optionVar -query displayGridAxes`
- -displayGridLines `optionVar -query displayGridLines`
- -displayDivisionLines `optionVar -query displayDivisionLines`
- -displayPerspectiveLabels `optionVar -query displayGridPerspLabels`
- -displayOrthographicLabels `optionVar -query displayGridOrthoLabels`
- -displayAxesBold `optionVar -query displayGridAxesAccented`
- -perspectiveLabelPosition `optionVar -query displayGridPerspLabelPosition`
- -orthographicLabelPosition `optionVar -query displayGridOrthoLabelPosition`
- ;
-
- toggle -nc -ep -state `optionVar -q newCurveDisplayEP`;
- toggle -nc -hull -state `optionVar -q newCurveDisplayHull`;
- toggle -nc -cv -state `optionVar -q newCurveDisplayCV`;
- toggle -ns -ep -state `optionVar -q newSurfaceDisplayEP`;
- toggle -ns -hull -state `optionVar -q newSurfaceDisplayHull`;
- toggle -ns -cv -state `optionVar -q newSurfaceDisplayCV`;
-
- displaySmoothness -dc -du `optionVar -q newNurbsIsoparms`;
- displaySmoothness -dc -pw `optionVar -q newNurbsPointsWire`;
- displaySmoothness -dc -ps `optionVar -q newNurbsPointsShaded`;
-
- if (`isTrue "PolygonsExists"`) {
- polyOptions -np -dv `optionVar -q newPolyVtxDisp`;
- polyOptions -np -bcv `optionVar -q newPolyVtxBackCull`;
-
- if( `optionVar -q newPolyVertexNormals`)
- if(`optionVar -q newPolyFacetNormalDisp`)
- polyOptions -np -dn 1 -pf;
- else
- polyOptions -np -dn 1 -pt;
- else
- if(`optionVar -q newPolyFacetNormalDisp`)
- polyOptions -np -dn 1 -f;
- else
- polyOptions -np -dn 0 -f;
-
- $state = `optionVar -q newPolyEdgeDisp`;
- if( $state == 0 )
- polyOptions -np -ae;
- else if( $state == 1 )
- polyOptions -np -se;
- else if( $state == 2 )
- polyOptions -np -he;
-
- polyOptions -np -sb `optionVar -q newPolyBorderEdgeSize`;
- polyOptions -np -db `optionVar -q newPolyBorderEdgeHilite`;
- polyOptions -np -dmb `optionVar -q newPolyBorderMapHilite`;
- polyOptions -np -sn `optionVar -q newPolyNormalSize`;
- polyOptions -np -dc `optionVar -q newPolyFacetCentreDisp`;
- polyOptions -np -dt `optionVar -q newPolyFacetTrngleDisp`;
- polyOptions -np -dw `optionVar -q newPolyFacetWarpDisp`;
- polyOptions -np -din
- `optionVar -q newPolyNumVertexDisp`
- `optionVar -q newPolyNumEdgeDisp`
- `optionVar -q newPolyNumFacetDisp`
- `optionVar -q newPolyNumUvDisp`;
-
- $state = `optionVar -q newPolyBackFaceCull`;
- if( $state == 0 )
- polyOptions -np -bc;
- else if( $state == 1 )
- polyOptions -np -fb;
- else if( $state == 2 )
- polyOptions -np -wbc;
- else if( $state == 3 )
- polyOptions -np -hb;
-
- polyOptions -np -cs `optionVar -q newPolyColorShaded`;
- string $colorChannelStrings[] = {"none", "ambient", "ambientDiffuse",
- "diffuse", "specular", "emission"};
- int $channel = `optionVar -q newPolyColorChannel`;
- if ($channel >= 0 && $channel < 5)
- polyOptions -np -cm $colorChannelStrings[$channel];
- else
- polyOptions -np -cm "diffuse";
- }
-
- //
- // Manipulators
- //
-
- global int $gRefreshMode;
- $gRefreshMode = `optionVar -q refreshMode`;
-
- manipOptions
- -refreshMode $gRefreshMode
- -scale `optionVar -q manipGlobalScale`
- -handleSize `optionVar -q manipHandleSize`
- -lineSize `optionVar -q manipLineSize`
- -linePick `optionVar -q manipLinePickSize`
- -pointSize `optionVar -q manipPreviousStateSize`;
-
- animDisplay -modelUpdate interactive;
- switch ($gRefreshMode) {
- case 0: // Normal
- animDisplay -modelUpdate interactive;
- break;
- case 1: // On Release
- animDisplay -modelUpdate delayed;
- break;
- case 2: // On Force
- animDisplay -modelUpdate none;
- break;
- }
-
- // Performance settings.
- //
- // Valid defaults are "0", "1", and "interactive".
- //
- string $kDefaultStitchSurfaces = "0";
- string $kDefaultTrimDisplay = "0";
- string $kDefaultLattices = "0";
- string $kDefaultLatticeResolution = "0";
- //
- // Valid defaults are 0.0, 0.01, 0.05, and 0.1.
- // See performanceSettingsWin.mel for more info.
- //
- float $kDefaultGlobalLatticeResolution = 0.01;
-
- // If the performance setting preference doesn't exist then
- // create it and set to the default values.
- //
- if (!`optionVar -exists performanceSettingStitchSurfaces`) {
- optionVar -stringValue performanceSettingStitchSurfaces
- $kDefaultStitchSurfaces;
- }
- performanceOptions -disableStitch
- `optionVar -query performanceSettingStitchSurfaces`;
-
- if (!`optionVar -exists performanceSettingTrimDisplay`) {
- optionVar -stringValue performanceSettingTrimDisplay
- $kDefaultTrimDisplay;
- }
- performanceOptions -disableTrimDisplay
- `optionVar -query performanceSettingTrimDisplay`;
-
- if (!`optionVar -exists performanceSettingLattices`) {
- optionVar -stringValue performanceSettingLattices
- $kDefaultLattices;
- }
- performanceOptions -passThroughLattice
- `optionVar -query performanceSettingLattices`;
-
- if (!`optionVar -exists performanceSettingLatticeResolution`) {
- optionVar -stringValue performanceSettingLatticeResolution
- $kDefaultLatticeResolution;
- }
- performanceOptions -useLatticeResolution
- `optionVar -query performanceSettingLatticeResolution`;
-
- if (!`optionVar -exists performanceSettingGlobalLatticeResolution`) {
- optionVar -floatValue performanceSettingGlobalLatticeResolution
- $kDefaultGlobalLatticeResolution;
- }
- performanceOptions -latticeResolution
- `optionVar -query performanceSettingGlobalLatticeResolution`;
-
- // More performance settings. Notice that these are only valid
- // in the Complete version of Maya.
- //
- if (`licenseCheck -mode "edit" -type "complete"`) {
-
- // Valid defaults are "0", "1", and "interactive".
- //
- string $kDefaultFlexors = "0";
- string $kDefaultBindSkinAndFlexors = "0";
- string $kDefaultSculpts = "0";
- string $kDefaultWires = "0";
- string $kDefaultBlendShapes = "0";
- string $kDefaultClusters = "0";
- string $kDefaultClusterResolution = "0";
- //
- // Valid defaults are 0.0, 1.0, 5.0, or 10.0.
- // See performanceSettingsWin.mel for more info.
- //
- float $kDefaultGlobalClusterResolution = 5.0;
-
- // If the performance setting preference doesn't exist then
- // create it and set to the default values.
- //
- if (!`optionVar -exists performanceSettingFlexors`) {
- optionVar -stringValue performanceSettingFlexors
- $kDefaultFlexors;
- }
- performanceOptions -passThroughFlexors
- `optionVar -query performanceSettingFlexors`;
-
- if (!`optionVar -exists performanceSettingBindSkinAndFlexors`) {
- optionVar -stringValue performanceSettingBindSkinAndFlexors
- $kDefaultBindSkinAndFlexors;
- }
- performanceOptions -passThroughBindSkinAndFlexors
- `optionVar -query performanceSettingBindSkinAndFlexors`;
-
- if (!`optionVar -exists performanceSettingSculpts`) {
- optionVar -stringValue performanceSettingSculpts
- $kDefaultSculpts;
- }
- performanceOptions -passThroughSculpt
- `optionVar -query performanceSettingSculpts`;
-
- if (!`optionVar -exists performanceSettingWires`) {
- optionVar -stringValue performanceSettingWires
- $kDefaultWires;
- }
- performanceOptions -passThroughWire
- `optionVar -query performanceSettingWires`;
-
- if (!`optionVar -exists performanceSettingBlendShapes`) {
- optionVar -stringValue performanceSettingBlendShapes
- $kDefaultBlendShapes;
- }
- performanceOptions -passThroughBlendShape
- `optionVar -query performanceSettingBlendShapes`;
-
- if (!`optionVar -exists performanceSettingClusters`) {
- optionVar -stringValue performanceSettingClusters
- $kDefaultClusters;
- }
- performanceOptions -passThroughCluster
- `optionVar -query performanceSettingClusters`;
-
- if (!`optionVar -exists performanceSettingClusterResolution`) {
- optionVar -stringValue performanceSettingClusterResolution
- $kDefaultClusterResolution;
- }
- performanceOptions -useClusterResolution
- `optionVar -query performanceSettingClusterResolution`;
-
- if (!`optionVar -exists performanceSettingGlobalClusterResolution`) {
- optionVar -floatValue performanceSettingGlobalClusterResolution
- $kDefaultGlobalClusterResolution;
- }
- performanceOptions -clusterResolution
- `optionVar -query performanceSettingGlobalClusterResolution`;
- }
-
- //
- // Paint Effects
- //
- if(`isTrue MayaCreatorExists`) {
- string $kDefaultPaintEffects = "0";
- if (!`optionVar -exists performanceSettingPaintEffects`) {
- optionVar -stringValue performanceSettingPaintEffects
- $kDefaultPaintEffects;
- }
- performanceOptions -passThroughPaintEffects
- `optionVar -query performanceSettingPaintEffects`;
- }
-
- //
- // Modelling
- //
- tolerance
- -l `optionVar -q positionalTolerance`
- -a `optionVar -q tangentialTolerance`;
-
-
- // This line is causing the preferences to not be shown
- // correctly in the pref window when the kin UI is not
- // loaded by default. See bug#81262 among others.
- // if (`isTrue "KinematicsUIExists"`) {
-
- jointDisplayScale `optionVar -q ikJointDisplayScale`;
- jointDisplayScale -ikfk `optionVar -q ikIkFkJointDisplayScale`;
- ikHandleDisplayScale `optionVar -q ikHandleDisplayScale`;
- ikfkDisplayMethod -display `optionVar -q ikIkFkDisplayMethod`;
-
- //
- // Dynamics
- //
-
- if (`isTrue "DynamicsExists"`)
- {
- // Set the preferences into the "current preference" globals.
- //
- dynPref -ac `optionVar -q dynPrefAutoCreate`;
- dynPref -rt `optionVar -q dynPrefRunupToCurrentTime`;
- dynPref -rf `optionVar -q dynPrefRunupFrom`;
- dynPref -sr `optionVar -q dynPrefSaveRuntimeState`;
- }
-
- //
- // Initialize the filter UI.
- //
- source filterUI.mel;
-
- //
- // Initialize the help.
- //
- source "initHelp.mel";
-